package com.highbury5.blog.controller;

import com.highbury5.blog.service.LikeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("like")
public class LikeController {

    @Autowired
    LikeService likeService;

    @RequestMapping("add/{articleId}")
    @ResponseBody
    public String add(@PathVariable("articleId") int articleId){
        return  likeService.add(articleId);
    }

    @RequestMapping("get/{articleId}")
    @ResponseBody
    public String get(@PathVariable("articleId") int articleId){
        return likeService.get(articleId);
    }

}
